package com.vhly.ddxdecompiler.dexreader.file.dalv.code.reader;

import com.vhly.ddxdecompiler.dexreader.file.dalv.code.DalvInsn;
import com.vhly.ddxdecompiler.dexreader.io.DexInputStream;

import java.io.IOException;


public final class Form35c extends InsnReader {

    public static final InsnReader THE_ONE = new Form35c();
    private static final int MAX_NUM_OPS = 5;

    private Form35c() {
    }

    public void prepair(DalvInsn dalvInsn, int reg) {
        int r4 = reg & 0x0f;
        int sz = (reg >> 4) & 0x0f;
        dalvInsn.addRegister(r4);
        dalvInsn.addRegister(sz);
    }

    public int read(DalvInsn insn, DexInputStream din) throws IOException {
        short cpi = din.readShort();
        short c1 = din.readShort();
        int r0 = c1 & 0x0f;
        int r1 = (c1 >> 4) & 0x0f;
        int r2 = (c1 >> 8) & 0x0f;
        int r3 = (c1 >> 12) & 0x0f;
        insn.addRegister(cpi);
        insn.addRegister(r0);
        insn.addRegister(r1);
        insn.addRegister(r2);
        insn.addRegister(r3);
        return 2;
    }
}